import 'package:flutter/material.dart';

class AppColors {
  static const Color primary = Color(0xff2a64ae);

  static const Color success = Color(0xff07c160);

  static const Color danger = Color(0xffc93639);

  static const Color warning = Color(0xffffc107);

  static const Color vip = Color(0xffCBA43F);

  static const Color active = Color(0xff333333);

  static const Color active2 = Color(0xff545454);

  static const Color unactive = Color(0xff7b7b7b);

  static const Color unactive2 = Color(0xff8d8d8d);

  static const Color unactive3 = Color(0xffaaaaaa);

  static const Color unactive4 = Color(0xffBDBDBD);

  static const Color unactive5 = Color(0xffE2E2E2);

  static const Color border = Color(0xffeeeeee);

  static const Color page = Color(0xfff7f7f7);

  static const Color nav = Color(0xfffbfbfb);

  /// 颜色值转换
  static Color string2Color(String colorString) {
    int value = 0x00000000;
    if (colorString.isNotEmpty) {
      if (colorString[0] == '#') {
        colorString = colorString.substring(1);
      }
      value = int.tryParse(colorString, radix: 16)!;
      if (value < 0xFF000000) {
        value += 0xFF000000;
      }
    }
    return Color(value);
  }
}
